package cn.jetpiece.cloud.log.app.modular.log.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 网关日志
 * </p>
 *
 * @author XuJZ
 * @since 2022-05-17
 */
@TableName("common_gateway_log")
public class GatewayLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * UUID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户编号
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 用户编号
     */
    @TableField("username")
    private String username;

    /**
     * 访问实例
     */
    @TableField("target_server")
    private String targetServer;

    /**
     * IP地址
     */
    @TableField("ip_address")
    private String ipAddress;

    /**
     * 请求协议
     */
    @TableField("request_schema")
    private String requestSchema;

    /**
     * 请求方法
     */
    @TableField("request_method")
    private String requestMethod;

    /**
     * 请求路径
     */
    @TableField("request_path")
    private String requestPath;

    /**
     * 请求头部
     */
    @TableField("request_header")
    private String requestHeader;

    /**
     * 请求体
     */
    @TableField("request_body")
    private String requestBody;

    /**
     * 请求体
     */
    @TableField("response_data")
    private String responseData;

    /**
     * 请求时间
     */
    @TableField("request_time")
    private Date requestTime;

    /**
     * 相应时间
     */
    @TableField("response_time")
    private Date responseTime;

    /**
     * 创建时间
     */
    @TableField("execute_time")
    private Long executeTime;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getTargetServer() {
        return targetServer;
    }

    public void setTargetServer(String targetServer) {
        this.targetServer = targetServer;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getRequestSchema() {
        return requestSchema;
    }

    public void setRequestSchema(String requestSchema) {
        this.requestSchema = requestSchema;
    }

    public String getRequestMethod() {
        return requestMethod;
    }

    public void setRequestMethod(String requestMethod) {
        this.requestMethod = requestMethod;
    }

    public String getRequestPath() {
        return requestPath;
    }

    public void setRequestPath(String requestPath) {
        this.requestPath = requestPath;
    }

    public String getRequestHeader() {
        return requestHeader;
    }

    public void setRequestHeader(String requestHeader) {
        this.requestHeader = requestHeader;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseData() {
        return responseData;
    }

    public void setResponseData(String responseData) {
        this.responseData = responseData;
    }

    public Date getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(Date requestTime) {
        this.requestTime = requestTime;
    }

    public Date getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(Date responseTime) {
        this.responseTime = responseTime;
    }

    public Long getExecuteTime() {
        return executeTime;
    }

    public void setExecuteTime(Long executeTime) {
        this.executeTime = executeTime;
    }

    @Override
    public String toString() {
        return "GatewayLog{" +
        "id=" + id +
        ", userId=" + userId +
        ", username=" + username +
        ", targetServer=" + targetServer +
        ", ipAddress=" + ipAddress +
        ", requestSchema=" + requestSchema +
        ", requestMethod=" + requestMethod +
        ", requestPath=" + requestPath +
        ", requestHeader=" + requestHeader +
        ", requestBody=" + requestBody +
        ", responseData=" + responseData +
        ", requestTime=" + requestTime +
        ", responseTime=" + responseTime +
        ", executeTime=" + executeTime +
        "}";
    }
}
